﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Pool.DataBase.DAL;

namespace Pool.Business.BLL
{
    public class BaseBLL
    {
        private const string DAL_ASSEMBLY_FORMAT = "Pool.DataBase.DAL.{0}DAL";

        private IDAL m_DataContext = null;
        protected IDAL DataContext { get { return m_DataContext; } }

        public BaseBLL()
        {
            string dalTypeName = string.Format(DAL_ASSEMBLY_FORMAT, GetType().Name.Replace("BLL", ""));
            m_DataContext = Activator.CreateInstance(typeof(IDAL).Assembly.GetType(dalTypeName)) as IDAL;
        }
    }
}
